package cn.ly.bank;

public class BankAccount {
	
	//定义属性
	//java基本数据类型
/*  boolean b = false/true;
	byte b2 = ;             //-128~127 ,1字节
	char c = 'a';           //2字节    -2^16~2^16-1
	short s = ;             //2字节    
	int i = 18;             //4字节
	long l = 18l;           //8字节
	float f = 1.8f;         //4字节
	double d = 1.8d;        //8字节
*/	
	
	private double balance;//余额
	public BankAccount(double openingBalance){
		this.balance = openingBalance;
	}
	
	//存款
	public void deposit(double amount){
		this.balance += amount;
	}
	
	//取款
	public void withdraw(double amount){
		this.balance -= amount;
	}
	
	//查看余额
	public void display(){
		System.out.println("balance=" + this.balance);
	}

}
